﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;
using Model.TempClass;
namespace BLL
{
   public class SysProcessBLL
    {
        SysProcessDAL dal = new SysProcessDAL();
        /// <summary>
        /// 添加节点
        /// </summary>
        /// <param name="Flow"></param>
        /// <returns></returns>
        public int Add(FlowModel Flow)
        {
            return dal.Add(Flow);
        }
        /// <summary>
        /// 修改样式
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int EditStyle(SysProcess entity)
        {
            return dal.EditStyle(entity);
        }
        /// <summary>
        /// 保存详情
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int SaveDetail(SysProcess entity)
        {
            return dal.SaveDetail(entity);
        }
        /// <summary>
        /// 根据id获取节点详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public SysProcess GetDateil(int id)
        {
            return dal.GetDateil(id);
        }
        /// <summary>
        /// 获取OA审批角色信息
        /// </summary>
        /// <param name="flowid"></param>
        /// <returns></returns>
        public List<SelectModel> GetRole(string flowid)
        {
            return dal.GetRole(flowid);
        }
        /// <summary>
        /// 获取操作事件
        /// </summary>
        /// <returns></returns>
        public List<SelectModel> GetOperation()
        {
            return dal.GetOperation();
        }
        /// <summary>
        /// 获取操作权限
        /// </summary>
        /// <returns></returns>
        public List<SelectModel> GetBtn()
        {
            return dal.GetBtn();
        }
        /// <summary>
        /// 获取审批意见
        /// </summary>
        /// <returns></returns>
        public List<SelectModel> GetItem()
        {
            return dal.GetItem();
        }
        /// <summary>
        /// 获取可退回的步骤
        /// </summary>
        /// <returns></returns>
        public List<SelectModel> GetBackProcess(int flowID)
        {
            return dal.GetBackProcess(flowID);
        }
        /// <summary>
        /// 获取当前流程所有步骤
        /// </summary>
        /// <param name="flow"></param>
        /// <returns></returns>
        public List<SysProcess> GetList(int flow)
        {
            return dal.GetList(flow);
        }
        /// <summary>
        /// 获取当前步骤和下一步骤的关系
        /// </summary>
        /// <param name="process_id"></param>
        /// <returns></returns>
        public List<SysRelation> GetRelation(int process_id)
        {
            return dal.GetRelation(process_id);
        }
        /// <summary>
        /// 添加关系
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int AddRelation(SysRelation entity)
        {
            return dal.AddRelation(entity);
        }
        /// <summary>
        /// 根据步骤id，删除有关的关系数据
        /// </summary>
        /// <param name="process_id"></param>
        /// <returns></returns>
        public int DeleteRelationAll(int process_id)
        {
            return dal.DeleteRelationAll(process_id);
        }
        /// <summary>
        /// 根据id删除步骤
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteProcess(int id)
        {
            return dal.DeleteProcess(id);
        }
        /// <summary>
        /// 获取当前流程的全部关系数据
        /// </summary>
        /// <param name="flowid"></param>
        /// <returns></returns>
        public List<SysRelation> GetRelationAll(int flowid)
        {
            return dal.GetRelationAll(flowid);
        }
    }
}
